//
//  ESTActivityEffectiveView.m
//  ESTSCRMAPP
//
//  Created by 李贤立 on 2018/10/16.
//  Copyright © 2018年 Capfer. All rights reserved.
//

#import "ESTActivityEffectiveView.h"

@interface ESTActivityEffectiveView ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIView *line;

@end

@implementation ESTActivityEffectiveView

/**
 创建是否进行中的按钮

 @param title 文字
 @return 创建控件
 */
+ (instancetype)creatActivityEffectiveViewWithTitle:(NSString *)title {
    ESTActivityEffectiveView *view = [[NSBundle mainBundle] loadNibNamed:@"ESTActivityEffectiveView" owner:nil options:nil].lastObject;
    view.title = title;
    view.line.hidden = YES;
    return view;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    self.line.backgroundColor = ThemeColor;
}
- (IBAction)didClickCoverButton:(UIButton *)sender {
    if (self.didCliclCoverBlock) {
        self.didCliclCoverBlock();
    }
}
- (void)setTitle:(NSString *)title {
    _title = title;
    self.titleLabel.text = title;
}
- (void)setIsSelected:(BOOL)isSelected {
    _isSelected = isSelected;
    self.line.hidden = !isSelected;
    if (isSelected) {
        self.titleLabel.textColor = ThemeColor;
        self.line.hidden = NO;
    } else {
        self.titleLabel.textColor = TYZBlackColor;
        self.line.hidden = YES;
    }
}
@end
